package com.xszx.serviceedu.controller;

import com.xszx.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 白熊
 * @Date: 2024/7/12 10:06
 */
@RestController
@RequestMapping("/serviceedu/user")
//@CrossOrigin//解决跨域问题
@Api(tags = "登录管理")
public class LoginController {

    @ApiOperation("登录")
    @PostMapping("login")
    public R login(){
        return R.ok().data("token","admin");//响应给前端
    }

    @ApiOperation("信息")
    @GetMapping("info")
    public R info(){
        return R.ok().data("roles","[高级管理员]")
                .data("name", "白熊")
                .data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }
}
